#include <iostream>
#include <cstdlib>
using namespace std;

int main()
{
   int a1,a2,n;
   cin >> a1 >> a2 >> n;
   long long sum = a1+a2;
   int d = a2-a1;//a1+d+d=a3
   if(n==1)
   cout << a1;
   else if (n == 2)
   cout << a2;
   else
   cout << a2 +(n-2)*d;
 } 
